\# A collection of macros for groff ms.
.
\# Break and separate
.de SP
.	br
.	sp
..
.
\# Remove trailing dot in headers
.als SN-STYLE SN-NO-DOT
.
.de TD
.	SP
.	gcolor red
.	B "\\$*"
.	gcolor
.	SP
..
.
\# Draw an horizontal line of width equal to line length
.de HL
.	nop \l'\n[.l]u'
..
.
\# Captions
.nr fig_count 0 1
.de CP
.	ce 
.	nop \f[B]Fig. \\n+[fig_count].\f[] \\$*
.	sp
..
.
\# Automatic table of contents entry when adding a section
\# Also appropriately infers depth from last explicit depth definition
.nr infered_depth 0 1
.de H
.	ie !'\?\\$2\?'\?\?' \{
.		nr infered_depth \\$2 1
.		NH \\$2
.	\}
.	el \{
.		NH \\n+[infered_depth]
.		nr infered_depth -1
.	\}
.	ps +2
.	XN \h'1'\\$1
.	ps
..
.
\# Like .H, but allows for TOC entry different from header text
.de FH
.	nr indent \\$3*2
.	NH \\$3
.	ps +2
.	nop \h'1'\\$1
.	XS
.	nop \h'\\n[indent]n'\\$2
.	ps
.	XE
..
.
\# Bullet points
.de BL
.	IP \(bu 2
..
.
\# Verbatim mode
.de VBS VBE
.	ev verbatim-env
.	evc 0
.	nf
.VBE
.
.de VBE
.	ev
..
.
\# Code block
.de CBS CBE Test
.	ds caption \\$*
.	sp
.	br
.	RS
.	CW
.	VBS
.	br
.CBE
.
.de CBE
.	VBE
.	RE
.	sp
.	CP \\*[caption]
.	rm caption
..
